package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.R;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.nursing.service.MemberOrdersService;
import com.zzyl.serve.domain.NursingProject;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


import java.util.List;

import static com.zzyl.common.utils.PageUtils.startPage;

@RestController
@RequestMapping("/member/orders/project")
public class MemberOrdersController extends BaseController {
    @Autowired
    private MemberOrdersService memberOrdersService;

    @GetMapping("/page")
    public TableDataInfo<List<NursingProject>> list(NursingProject nursingProject) {
        startPage();
        List<NursingProject> list = memberOrdersService.selectNursingProjectList(nursingProject);
        return getDataTable(list);
    }
    @GetMapping(value = "/{id}")
    @ApiOperation("获取护理项目详细信息")
    public R<NursingProject> getInfo(@ApiParam(value = "护理项目ID", required = true)
                                     @PathVariable("id") Long id) {
        return R.ok(memberOrdersService.selectNursingProjectById(id));
    }
}
